home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
gsdbloo.exe
/
DEMOE001.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-24
|
3KB
|
81 lines
program DemoE001;
{------------------------------------------------------------------------------
DBase File Display
Expanded Sample 1
Demo Program
Copyright (c) Richard F. Griffin
10 February 1992
102 Molded Stone Pl
Warner Robins, GA 31088
-------------------------------------------------------------
Display all record fields on-screen.
********** Not For Use in a TurboVision Environment **********
If it does not already exist, the DEMOE1.DBF file will be created
by using the MakeTestData procedure in GS_GENF.PAS.
All fields in the dBase record will be displayed on-screen using
the FieldDisplay procedure in GS_dBFld_Objt.
The WaitForKey procedure from GS_KEYI.PAS is also demonstrated as
a simple call to wait for a key press (and clear the pressed key).
-------------------------------------------------------------------------------}
uses
CRT,
DOS,
GS_KeyI,
GS_dBFld,
GS_dBase,
GS_FileH,
GS_GenF;
var
MyFile : GS_dBFld_Objt;
CkFile : file;
procedure DisplayRecord;
begin
MyFile.FieldDisplay('LASTNAME','Last Name: ',1,1);
MyFile.FieldDisplay('FIRSTNAME','First Name, Middle Initial: ',1,2);
MyFile.FieldDisplay('STREET','Street Address: ',1,3);
MyFile.FieldDisplay('OFFICE','Building, suite, etc: ',1,4);
MyFile.FieldDisplay('CITY','City: ',1,5);
MyFile.FieldDisplay('STATE','State: ',1,6);
MyFile.FieldDisplay('ZIP','Zip Code: ',1,7);
MyFile.FieldDisplay('TELEPHONE','Telephone Number: ',1,8);
MyFile.FieldDisplay('BIRTHDATE','Date of Birth: ',1,9);
MyFile.FieldDisplay('PAYMENT','Payment Amount: ',1,10);
MyFile.FieldDisplay('PAIDFLAG','Amount Was Paid?: ',1,11);
MyFile.FieldDisplay('RANDOMNUM','Random Number: ',1,12);
end;
begin
ClrScr;
if not GS_FileExists(CkFile,'DEMOE1.DBF') then
begin
writeln('Creating DemoE1.DBF');
MakeTestData('DemoE1', 20, false);
writeln('DemoE1.DBF Created');
ClrScr;
end;
GotoXY(1,15);
write('Press ESC to stop, any other key to continue');
MyFile.Init('DEMOE1');
MyFile.Open;
MyFile.GetRec(Top_Record);
while not MyFile.File_EOF do
begin
DisplayRecord;
WaitForKey;
if GS_KeyI_Chr = Kbd_Esc then halt;
MyFile.GetRec(Next_Record);
end;
MyFile.Close;
end.